<?php
defined ( '_JEXEC' ) or die ( 'Restricted access' );
class HTML_fudbal {
function editResult($row, $lists, $option) {
		JHTML::_ ( 'behavior.calendar' );
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<fieldset class="adminform"><legend>Swimmer time details</legend>
<table class="admintable">
	<tr>
		<td width="100" align="right" class="key">Swimmer:</td>
		<td>
			<?php
					echo $lists ['swimmers'];
			?>
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Meet:</td>
		<td>
			<?php
					echo $lists ['meets'];
			?>
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Course:</td>
		<td>
			<?php
					echo $lists ['courses'];
			?>
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Stroke:</td>
		<td>
			<?php
					echo $lists ['strokes'];
			?>
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Distance:</td>
		<td>
			<?php
					echo $lists ['distances'];
			?>
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Race Type:</td>
		<td>
			<?php
					echo $lists ['racetypes'];
			?>
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Time:</td>
		<td>
			<input class="text_area" type="text" name="timemin" id="timemin"
				size="2" maxlength="2" value="<?php echo $row->minutes;?>" />
				<b><?php echo ':'; ?></b>
			<input class="text_area" type="text" name="timesec" id="timesec"
				size="2" maxlength="2" value="<?php echo $row->seconds;?>" />
				<b><?php echo '.'; ?></b>
			<input class="text_area" type="text" name="timehun" id="timehun"
				size="2" maxlength="2" value="<?php echo $row->hundreds;?>" />
			<?php echo '(minutes : seconds . hundreds)'; ?>			
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Rank:</td>
		<td>
			<input class="text_area" type="text" name="rank" id="rank"
			size="5" maxlength="2" value="<?php echo $row->rank;?>" />
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Lane:</td>
		<td>
			<?php
					echo $lists ['lanes'];
			?>
		</td>
	</tr>
	<tr>
		<td width="100" align="right" class="key">Result Date:</td>
		<td>
			<input class="inputbox" type="text" name="result_date"
				id="result_date" size="25" maxlength="19"
				value="<?php echo $row->result_date;?>" /> 
			<script type="text/javascript">
				Calendar.setup({inputField : "result_date",ifFormat : "%Y-%m-%d",showsTime : false,singleClick: true});
			</script>
		</td>
	</tr>
</table>
</fieldset>
<input type="hidden" name="id" value="<?php	echo $row->id;?>" /> 
<input type="hidden" name="option" value="<?php echo $option;?>" /> 
<input type="hidden" name="task" value="" />
</form>
<?php
}

function prikaziUtakmice( $option, &$rows, &$pageNav ) {
		?>
<form action="index.php" method="post" name="adminForm">
<table class="adminlist">
	<thead>
		<tr>
			<th width="20"><input type="checkbox" name="toggle" value=""
				onclick="checkAll(<?php
		echo count ( $rows );
		?>);" /></th>
			<th class="title">Name</th>
			<th width="23%">Meet</th>
			<th width="5%">Distance</th>
			<th width="5%">Stroke</th>
			<th width="3%">Course</th>
			<th width="5%">Time</th>
			<th width="3%">Rank</th>
			<th width="3%">Lane</th>
			<th width="7%">Race type</th>
			<th width="7%">Result date</th>
			<th width="3%">Gender</th>
			<th width="5%">Age group</th>			
			<th width="13%" nowrap="nowrap">Coach</th>
		</tr>
	</thead>
<?php
		jimport('joomla.filter.filteroutput');
		$k = 0;
		for($i = 0, $n = count ( $rows ); $i < $n; $i ++) {
			$row = &$rows [$i];
			$checked = JHTML::_ ( 'grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
					$option . '&task=edit&cid[]='. $row->id );
			?>
<tr class="<?php
			echo "row$k";
			?>">
		<td>
<?php
			echo $checked;
			?>
</td>
		<td><a href="<?php echo $link; ?>">
	<?php echo $row->firstname.' '.$row->middlename.' '.$row->lastname ; ?></a>
		</td>
		<td>
<?php
			echo $row->name;
			?>
</td>
		<td>
<?php
			echo $row->distance.$row->unit;
			?>
</td>
		<td>
<?php
			echo $row->stroke_name;
			?>
</td>
		<td>
<?php
			echo $row->course_type_name;
			?>
</td>
		<td>
<?php
			echo $row->time;
			?>
</td>
		<td>
<?php
			echo $row->rank;
			?>
</td>
		<td>
<?php
			echo $row->lane;
			?>
</td>
		<td>
<?php
			echo $row->race_type_name;
			?>
</td>
		<td>
<?php
			echo $row->result_date;
			?>
</td>
		<td>
<?php
	if($row->cb_gender == 'Male'){
		echo 'Boys';
	}else{		
		echo 'Girls';
	}
			?>
</td>
		<td>
<?php
			echo $row->cb_agegroup;
			?>
</td>
		<td align="center">
<?php
			echo $row->cb_coach;
			?>
</td>
	</tr>
<?php
			$k = 1 - $k;
		}
		?>
		<tfoot>
				<td colspan="14"><?php echo $pageNav->getListFooter();?></td>
		</tfoot>
</table>
<input type="hidden" name="option" value="<?php	echo $option; ?>" /> 
<input type="hidden" name="task" value="" /> 
<input type="hidden" name="boxchecked" value="0" />
</form>
<?php
}

function prikaziKola( $option, &$rows, &$pageNav )
	{
	?>
	<form action="index.php" method="post" name="adminForm">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<input type="checkbox" name="toggle" value="" 
						       onclick="checkAll(<?php echo count( $rows ); ?>);" />
					</th>
					<th class="title"><?php echo JText::_( 'KOLO' );?></th>
					<th width="20%"><?php echo JText::_( 'KOLO_POCETAK' );?></th>
					<th width="20%"><?php echo JText::_( 'KOLO_KRAJ' );?></th>
					<th width="20%"><?php echo JText::_( 'KOLO_SEZONA' );?></th>
				</tr>
			</thead>
			<?php
			jimport('joomla.filter.filteroutput');
			$k = 0;
			for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
			$option . '&task=editujKolo&cid[]='. $row->id );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->ime;?></a></td>
				<td><?php echo JHTML::Date($row->pocetak); ?></td>
				<td><?php echo JHTML::Date($row->kraj); ?></td>
				<td><?php echo $row->sezona; ?></td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<td colspan="9"><?php echo $pageNav->getListFooter();?></td>
			</tfoot>
		</table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="meets" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<?php
	}
	
function editujKolo ($row, $lists, $option)
	{
	JHTML::_('behavior.calendar');
	?>
	<form action="index.php" method="post" name="adminForm"	id="adminForm">
	<fieldset class="adminform">
	<legend><?php echo JText::_( 'KOLO_DETAIL' );?></legend>
		<table>
			<tr>
				<td width="100" align="right" class="key">
					<?php echo JText::_( 'KOLO_NAME' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="ime"
						id="ime" size="50" maxlength="250" value="<?php echo
						$row->ime;?>" />
				</td>
			</tr>		
			<tr>
				<td width="100" align="right" class="key">
					<?php echo JText::_( 'KOLO_POCETAK' );?>:
				</td>
				<td>
					<input class="inputbox" type="text" name="pocetak"
						id="pocetak" size="25" maxlength="19" value="<?php echo
						$row->pocetak; ?>" />
					<script type="text/javascript">
						Calendar.setup({inputField : "pocetak",ifFormat : "%Y-%m-%d",showsTime : false,singleClick: true});
					</script>
				</td>
			</tr>
			<tr>
				<td width="100" align="right" class="key">
					<?php echo JText::_( 'KOLO_KRAJ' );?>:
				</td>
				<td>
					<input class="inputbox" type="text" name="kraj"
						id="kraj" size="25" maxlength="19" value="<?php echo
						$row->kraj; ?>" />
					<script type="text/javascript">
						Calendar.setup({inputField : "kraj",ifFormat : "%Y-%m-%d",showsTime : false,singleClick: true});
					</script>
				</td>
			</tr>
			<tr>
				<td width="100" align="right" class="key">
					<?php echo JText::_( 'KOLO_SEZONA' );?>:
				</td>
				<td>
					<?php
						echo $lists ['sezone'];
					?>
				</td>
			</tr>
		</table>
	</fieldset>
	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="task" value="" />
	</form>
	<?php
	}

function prikaziLige( $option, &$rows, &$pageNav )
	{
	?>
	<form action="index.php" method="post" name="adminForm">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<input type="checkbox" name="toggle" value="" 
						       onclick="checkAll(<?php echo count( $rows ); ?>);" />
					</th>
					<th class="title"><?php echo JText::_( 'LIGA' );?></th>
					<th width="6%"><?php echo JText::_( 'LIGA_AKTIVNA' );?></th>
					<th width="12%"><?php echo JText::_( 'LIGA_TIP' );?></th>
					<th width="18%"><?php echo JText::_( 'LIGA_RUKOVODSTVO1' );?></th>
					<th width="18%"><?php echo JText::_( 'LIGA_RUKOVODSTVO2' );?></th>
					<th width="18%"><?php echo JText::_( 'LIGA_RUKOVODSTVO3' );?></th>
				</tr>
			</thead>
			<?php
			jimport('joomla.filter.filteroutput');
			$k = 0;
			for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
			$option . '&task=editujLigu&cid[]='. $row->id );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->ime;?></a></td>
				<td><?php echo JHTML::_('grid.published', $row, $i, $imgY = 'tick.png', $imgX = 'publish_x.png', $prefix='liga' );?></td>
				<td><?php echo $row->tip_lige; ?></td>
				<td><?php echo $row->rukovodstvo_clan_1; ?></td>
				<td><?php echo $row->rukovodstvo_clan_2; ?></td>
				<td><?php echo $row->rukovodstvo_clan_3; ?></td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<td colspan="9"><?php echo $pageNav->getListFooter();?></td>
			</tfoot>
		</table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="lige" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<?php
	}
	
function editujLigu ($row, $lists, $option)
	{
	JHTML::_('behavior.calendar');
	?>
	<form action="index.php" method="post" name="adminForm"	id="adminForm">
	<fieldset class="adminform">
	<legend><?php echo JText::_( 'LIGA_DETALJI' );?></legend>
		<table>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'LIGA_IME' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="ime"
						id="ime" size="100" maxlength="250" value="<?php echo
						$row->ime;?>" />
				</td>
			</tr>		
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'LIGA_TIP' );?>:
				</td>
				<td>
					<?php
						echo $lists ['tip_lige'];
					?>
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'LIGA_RUKOVODSTVO1' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="rukovodstvo_clan_1"
						id="rukovodstvo_clan_1" size="100" maxlength="250" value="<?php echo
						$row->rukovodstvo_clan_1;?>" />
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'LIGA_RUKOVODSTVO2' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="rukovodstvo_clan_2"
						id="rukovodstvo_clan_2" size="100" maxlength="250" value="<?php echo
						$row->rukovodstvo_clan_2;?>" />
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'LIGA_RUKOVODSTVO3' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="rukovodstvo_clan_3"
						id="rukovodstvo_clan_3" size="100" maxlength="250" value="<?php echo
						$row->rukovodstvo_clan_3;?>" />
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'LIGA_AKTIVNA' );?>:
				</td>
				<td>
					<?php
						echo $lists ['aktivna'];
					?>
				</td>
			</tr>
		</table>
	</fieldset>
	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="task" value="" />
	</form>
	<?php
	}
	
function prikaziTrenere( $option, &$rows, &$pageNav )
	{
	?>
	<form action="index.php" method="post" name="adminForm">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<input type="checkbox" name="toggle" value="" 
						       onclick="checkAll(<?php echo count( $rows ); ?>);" />
					</th>
					<th class="title"><?php echo JText::_( 'TRENER' );?></th>
					<th width="10%"><?php echo JText::_( 'TRENER_AKTIVAN' );?></th>
					<th width="20%"><?php echo JText::_( 'TRENER_LICENCA' );?></th>
				</tr>
			</thead>
			<?php
			jimport('joomla.filter.filteroutput');
			$k = 0;
			for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
			$option . '&task=editujTrenera&cid[]='. $row->id );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->ime . ' ' . $row->prezime;?></a></td>
				<td><?php echo JHTML::_('grid.published', $row, $i, $imgY = 'tick.png', $imgX = 'publish_x.png', $prefix='trener' );?></td>
				<td><?php echo $row->licenca; ?></td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<td colspan="9"><?php echo $pageNav->getListFooter();?></td>
			</tfoot>
		</table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="treneri" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<?php
	}
	
function editujTrenera ($row, $lists, $option)
	{
	JHTML::_('behavior.calendar');
	?>
	<form action="index.php" method="post" name="adminForm"	id="adminForm">
	<fieldset class="adminform">
	<legend><?php echo JText::_( 'TRENER_DETALJI' );?></legend>
		<table>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_IME' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="ime"
						id="ime" size="100" maxlength="250" value="<?php echo
						$row->ime;?>" />
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_PREZIME' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="prezime"
						id="prezime" size="100" maxlength="250" value="<?php echo
						$row->prezime;?>" />
				</td>
			</tr>		
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_LICENCA' );?>:
				</td>
				<td>
					<?php
						echo $lists ['licenca'];
					?>
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_AKTIVAN' );?>:
				</td>
				<td>
					<?php
						echo $lists ['aktivan'];
					?>
				</td>
			</tr>
		</table>
	</fieldset>
	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="task" value="" />
	</form>
	<?php
	}

function prikaziKlubove( $option, &$rows, &$pageNav )
	{
	?>
	<form action="index.php" method="post" name="adminForm">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<input type="checkbox" name="toggle" value="" 
						       onclick="checkAll(<?php echo count( $rows ); ?>);" />
					</th>
					<th class="title"><?php echo JText::_( 'KLUB' );?></th>
					<th width="6%"><?php echo JText::_( 'KLUB_AKTIVAN' );?></th>
					<th width="15%"><?php echo JText::_( 'KLUB_LIGA' );?></th>
					<th width="15%"><?php echo JText::_( 'KLUB_PREDSEDNIK' );?></th>
					<th width="15%"><?php echo JText::_( 'KLUB_MESTO' );?></th>
					<th width="15%"><?php echo JText::_( 'KLUB_TELEFON' );?></th>
					<th width="7%"><?php echo JText::_( 'KLUB_BOJA_DRESA' );?></th>
					<th width="7%"><?php echo JText::_( 'KLUB_REZ_BOJA_DRESA' );?></th>
				</tr>
			</thead>
			<?php
			jimport('joomla.filter.filteroutput');
			$k = 0;
			for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
			$option . '&task=editujKlub&cid[]='. $row->id );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->ime;?></a></td>
				<td><?php echo JHTML::_('grid.published', $row, $i, $imgY = 'tick.png', $imgX = 'publish_x.png', $prefix='klub' );?></td>
				<td><?php echo $row->liga; ?></td>
				<td><?php echo $row->predesdnik; ?></td>
				<td><?php echo $row->mesto; ?></td>
				<td><?php echo $row->kontakt_tel; ?></td>
				<td><?php echo $row->osnovna_boja_dresa; ?></td>
				<td><?php echo $row->rezervna_boja_dresa; ?></td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<td colspan="9"><?php echo $pageNav->getListFooter();?></td>
			</tfoot>
		</table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="klubovi" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<?php
	}
	
function editujKlub ($row, $lists, $option)
	{
	JHTML::_('behavior.calendar');
	?>
	<form action="index.php" method="post" name="adminForm"	id="adminForm">
	<fieldset class="adminform">
	<legend><?php echo JText::_( 'TRENER_DETALJI' );?></legend>
		<table>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_IME' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="ime"
						id="ime" size="100" maxlength="250" value="<?php echo
						$row->ime;?>" />
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_PREZIME' );?>:
				</td>
				<td>
					<input class="text_area" type="text" name="prezime"
						id="prezime" size="100" maxlength="250" value="<?php echo
						$row->prezime;?>" />
				</td>
			</tr>		
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_LICENCA' );?>:
				</td>
				<td>
					<?php
						echo $lists ['licenca'];
					?>
				</td>
			</tr>
			<tr>
				<td width="120" align="right" class="key">
					<?php echo JText::_( 'TRENER_AKTIVAN' );?>:
				</td>
				<td>
					<?php
						echo $lists ['aktivan'];
					?>
				</td>
			</tr>
		</table>
	</fieldset>
	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="task" value="" />
	</form>
	<?php
	}	

function showMtimes( $option, &$rows, &$pageNav )
	{
	?>
	<form action="index.php" method="post" name="adminForm">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<input type="checkbox" name="toggle" value="" 
						       onclick="checkAll(<?php echo count( $rows ); ?>);" />
					</th>
					<th class="title">Age Group</th>
					<th width="10%">Gender</th>					
					<th width="11%">Distance</th>
					<th width="7%">Stroke</th>
					<th width="8%">Course</th>
					<th width="10%">Level</th>
					<th width="10%">Time</th>
				</tr>
			</thead>
			<?php
			jimport('joomla.filter.filteroutput');
			$k = 0;
			for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
			$option . '&task=editMtimes&cid[]='. $row->id );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?></td>
				<td><?php echo $row->age_group;?></td>
				<td><?php if($row->gender == 'Male'){
									echo 'Boys';
								}else{
									echo 'Girls';
								}; 
					?>
				</td>				
				<td><?php echo $row->distance . ' ' . $row->unit; ?></td>
				<td><?php echo $row->stroke; ?></td>
				<td><?php echo $row->course; ?></td>
				<td><?php echo $row->level; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->time; ?></a></td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<td colspan="9"><?php echo $pageNav->getListFooter();?></td>
			</tfoot>
		</table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="motiv_times" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<?php
	}
	
function editMtimes($row, $lists, $option) {
		JHTML::_ ( 'behavior.calendar' );
	?>
	<form action="index.php" method="post" name="adminForm" id="adminForm">
	<fieldset class="adminform"><legend>Motivational time details</legend>
	<table class="admintable">
		<tr>
			<td width="100" align="right" class="key">Age Group:</td>
			<td>
				<?php
						echo $lists ['agegroups'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Gender:</td>
			<td>
				<?php
						echo $lists ['gender'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Distance:</td>
			<td>
				<?php
						echo $lists ['distances'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Stroke:</td>
			<td>
				<?php
						echo $lists ['strokes'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Course:</td>
			<td>
				<?php
						echo $lists ['courses'];
				?>
			</td>
		</tr>		
		<tr>
			<td width="100" align="right" class="key">Level:</td>
			<td>
				<?php
						echo $lists ['timelevels'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Time:</td>
			<td>
				<input class="text_area" type="text" name="timemin" id="timemin"
					size="2" maxlength="2" value="<?php echo $row->minutes;?>" />
					<b><?php echo ':'; ?></b>
				<input class="text_area" type="text" name="timesec" id="timesec"
					size="2" maxlength="2" value="<?php echo $row->seconds;?>" />
					<b><?php echo '.'; ?></b>
				<input class="text_area" type="text" name="timehun" id="timehun"
					size="2" maxlength="2" value="<?php echo $row->hundreds;?>" />
				<?php echo '(minutes : seconds . hundreds)'; ?>			
			</td>
		</tr>
	</table>
	</fieldset>
	<input type="hidden" name="id" value="<?php	echo $row->id;?>" /> 
	<input type="hidden" name="option" value="<?php echo $option;?>" /> 
	<input type="hidden" name="task" value="" />
	</form>
	<?php
	}
	
function showMptimes( $option, &$rows, &$pageNav )
	{
	?>
	<form action="index.php" method="post" name="adminForm">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<input type="checkbox" name="toggle" value="" 
						       onclick="checkAll(<?php echo count( $rows ); ?>);" />
					</th>
					<th class="title">Age Group</th>
					<th width="10%">Gender</th>					
					<th width="11%">Distance</th>
					<th width="7%">Stroke</th>
					<th width="8%">Course</th>
					<th width="10%">Track</th>
					<th width="10%">Percent</th>
					<th width="10%">Time</th>
				</tr>
			</thead>
			<?php
			jimport('joomla.filter.filteroutput');
			$k = 0;
			for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
			$option . '&task=editMptimes&cid[]='. $row->id );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?></td>
				<td><?php echo $row->age_group;?></td>
				<td><?php if($row->gender == 'Male'){
									echo 'Boys';
								}else{
									echo 'Girls';
								}; 
					?>
				</td>				
				<td><?php echo $row->distance . ' ' . $row->unit; ?></td>
				<td><?php echo $row->stroke; ?></td>
				<td><?php echo $row->course; ?></td>
				<td><?php echo $row->track; ?></td>
				<td><?php echo $row->percent; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->time; ?></a></td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<td colspan="9"><?php echo $pageNav->getListFooter();?></td>
			</tfoot>
		</table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="motivp_times" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<?php
	}
	
function editMptimes($row, $lists, $option) {
		JHTML::_ ( 'behavior.calendar' );
	?>
	<form action="index.php" method="post" name="adminForm" id="adminForm">
	<fieldset class="adminform"><legend>Motivational percentile time details</legend>
	<table class="admintable">
		<tr>
			<td width="100" align="right" class="key">Age Group:</td>
			<td>
				<?php
						echo $lists ['agegroups'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Gender:</td>
			<td>
				<?php
						echo $lists ['gender'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Distance:</td>
			<td>
				<?php
						echo $lists ['distances'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Stroke:</td>
			<td>
				<?php
						echo $lists ['strokes'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Course:</td>
			<td>
				<?php
						echo $lists ['courses'];
				?>
			</td>
		</tr>		
		<tr>
			<td width="100" align="right" class="key">Track Percent:</td>
			<td>
				<?php
						echo $lists ['timetracks'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Time:</td>
			<td>
				<input class="text_area" type="text" name="timemin" id="timemin"
					size="2" maxlength="2" value="<?php echo $row->minutes;?>" />
					<b><?php echo ':'; ?></b>
				<input class="text_area" type="text" name="timesec" id="timesec"
					size="2" maxlength="2" value="<?php echo $row->seconds;?>" />
					<b><?php echo '.'; ?></b>
				<input class="text_area" type="text" name="timehun" id="timehun"
					size="2" maxlength="2" value="<?php echo $row->hundreds;?>" />
				<?php echo '(minutes : seconds . hundreds)'; ?>			
			</td>
		</tr>
	</table>
	</fieldset>
	<input type="hidden" name="id" value="<?php	echo $row->id;?>" /> 
	<input type="hidden" name="option" value="<?php echo $option;?>" /> 
	<input type="hidden" name="task" value="" />
	</form>
	<?php
	}
	
function showQtimes( $option, &$rows, &$pageNav )
	{
	?>
	<form action="index.php" method="post" name="adminForm">
		<table class="adminlist">
			<thead>
				<tr>
					<th width="20">
						<input type="checkbox" name="toggle" value="" 
						       onclick="checkAll(<?php echo count( $rows ); ?>);" />
					</th>					
					<th class="title">Meet</th>
					<th width="10%">Age Group</th>
					<th width="10%">Gender</th>					
					<th width="11%">Distance</th>
					<th width="7%">Stroke</th>
					<th width="8%">Course</th>
					<th width="10%">Time</th>
				</tr>
			</thead>
			<?php
			jimport('joomla.filter.filteroutput');
			$k = 0;
			for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
			$checked = JHTML::_('grid.id', $i, $row->id );
			$link = JFilterOutput::ampReplace( 'index.php?option=' .
			$option . '&task=editQtimes&cid[]='. $row->id );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?></td>				
				<td><?php echo $row->meet; ?></td>
				<td><?php echo $row->age_group;?></td>
				<td><?php if($row->gender == 'Male'){
									echo 'Boys';
								}else{
									echo 'Girls';
								}; 
					?>
				</td>				
				<td><?php echo $row->distance . ' ' . $row->unit; ?></td>
				<td><?php echo $row->stroke; ?></td>
				<td><?php echo $row->course; ?></td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->time; ?></a></td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<td colspan="9"><?php echo $pageNav->getListFooter();?></td>
			</tfoot>
		</table>
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="qf_times" />
		<input type="hidden" name="boxchecked" value="0" />
	</form>
	<?php
	}
	
function editQtimes($row, $lists, $option) {
		JHTML::_ ( 'behavior.calendar' );
	?>
	<form action="index.php" method="post" name="adminForm" id="adminForm">
	<fieldset class="adminform"><legend>Qualifying time details</legend>
	<table class="admintable">
		<tr>
			<td width="100" align="right" class="key">Meet:</td>
			<td>
				<?php
						echo $lists ['meets'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Age Group:</td>
			<td>
				<?php
						echo $lists ['agegroups'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Gender:</td>
			<td>
				<?php
						echo $lists ['gender'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Distance:</td>
			<td>
				<?php
						echo $lists ['distances'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Stroke:</td>
			<td>
				<?php
						echo $lists ['strokes'];
				?>
			</td>
		</tr>
		<tr>
			<td width="100" align="right" class="key">Course:</td>
			<td>
				<?php
						echo $lists ['courses'];
				?>
			</td>
		</tr>		
		<tr>
			<td width="100" align="right" class="key">Time:</td>
			<td>
				<input class="text_area" type="text" name="timemin" id="timemin"
					size="2" maxlength="2" value="<?php echo $row->minutes;?>" />
					<b><?php echo ':'; ?></b>
				<input class="text_area" type="text" name="timesec" id="timesec"
					size="2" maxlength="2" value="<?php echo $row->seconds;?>" />
					<b><?php echo '.'; ?></b>
				<input class="text_area" type="text" name="timehun" id="timehun"
					size="2" maxlength="2" value="<?php echo $row->hundreds;?>" />
				<?php echo '(minutes : seconds . hundreds)'; ?>			
			</td>
		</tr>
	</table>
	</fieldset>
	<input type="hidden" name="id" value="<?php	echo $row->id;?>" /> 
	<input type="hidden" name="option" value="<?php echo $option;?>" /> 
	<input type="hidden" name="task" value="" />
	</form>
	<?php
	}
}
?>